{"ast":null,"code":"import RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport RcCollapse from 'rc-collapse';\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport { ConfigContext } from '../config-provider';\nimport initCollapseMotion from '../_util/motion';\nimport { cloneElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nimport CollapsePanel from './CollapsePanel';\nimport useStyle from './style';\nconst Collapse = props => {\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    bordered = true,\n    ghost,\n    expandIconPosition = 'start'\n  } = props;\n  const prefixCls = getPrefixCls('collapse', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  // Warning if use legacy type `expandIconPosition`\n  process.env.NODE_ENV !== \"production\" ? warning(expandIconPosition !== 'left' && expandIconPosition !== 'right', 'Collapse', '`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.') : void 0;\n  // Align with logic position\n  const mergedExpandIconPosition = React.useMemo(() => {\n    if (expandIconPosition === 'left') {\n      return 'start';\n    }\n    return expandIconPosition === 'right' ? 'end' : expandIconPosition;\n  }, [expandIconPosition]);\n  const renderExpandIcon = function () {\n    let panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    const {\n      expandIcon\n    } = props;\n    const icon = expandIcon ? expandIcon(panelProps) : /*#__PURE__*/React.createElement(RightOutlined, {\n      rotate: panelProps.isActive ? 90 : undefined\n    });\n    return cloneElement(icon, () => ({\n      className: classNames(icon.props.className, `${prefixCls}-arrow`)\n    }));\n  };\n  const collapseClassName = classNames(`${prefixCls}-icon-position-${mergedExpandIconPosition}`, {\n    [`${prefixCls}-borderless`]: !bordered,\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-ghost`]: !!ghost\n  }, className, hashId);\n  const openMotion = Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false,\n    leavedClassName: `${prefixCls}-content-hidden`\n  });\n  const getItems = () => {\n    const {\n      children\n    } = props;\n    return toArray(children).map((child, index) => {\n      var _a;\n      if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {\n        const key = child.key || String(index);\n        const {\n          disabled,\n          collapsible\n        } = child.props;\n        const childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {\n          key,\n          collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined\n        });\n        return cloneElement(child, childProps);\n      }\n      return child;\n    });\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(RcCollapse, Object.assign({\n    openMotion: openMotion\n  }, props, {\n    expandIcon: renderExpandIcon,\n    prefixCls: prefixCls,\n    className: collapseClassName\n  }), getItems()));\n};\nCollapse.Panel = CollapsePanel;\nexport default Collapse;","map":{"version":3,"names":["RightOutlined","classNames","RcCollapse","React","toArray","omit","ConfigContext","initCollapseMotion","cloneElement","warning","CollapsePanel","useStyle","Collapse","props","getPrefixCls","direction","useContext","prefixCls","customizePrefixCls","className","bordered","ghost","expandIconPosition","rootPrefixCls","wrapSSR","hashId","process","env","NODE_ENV","mergedExpandIconPosition","useMemo","renderExpandIcon","panelProps","arguments","length","undefined","expandIcon","icon","createElement","rotate","isActive","collapseClassName","openMotion","Object","assign","motionAppear","leavedClassName","getItems","children","map","child","index","_a","disabled","key","String","collapsible","childProps","Panel"],"sources":["/data/messenger.client/node_modules/antd/es/collapse/Collapse.js"],"sourcesContent":["import RightOutlined from \"@ant-design/icons/es/icons/RightOutlined\";\nimport classNames from 'classnames';\nimport RcCollapse from 'rc-collapse';\nimport * as React from 'react';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport { ConfigContext } from '../config-provider';\nimport initCollapseMotion from '../_util/motion';\nimport { cloneElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nimport CollapsePanel from './CollapsePanel';\nimport useStyle from './style';\nconst Collapse = props => {\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    bordered = true,\n    ghost,\n    expandIconPosition = 'start'\n  } = props;\n  const prefixCls = getPrefixCls('collapse', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  // Warning if use legacy type `expandIconPosition`\n  process.env.NODE_ENV !== \"production\" ? warning(expandIconPosition !== 'left' && expandIconPosition !== 'right', 'Collapse', '`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.') : void 0;\n  // Align with logic position\n  const mergedExpandIconPosition = React.useMemo(() => {\n    if (expandIconPosition === 'left') {\n      return 'start';\n    }\n    return expandIconPosition === 'right' ? 'end' : expandIconPosition;\n  }, [expandIconPosition]);\n  const renderExpandIcon = function () {\n    let panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    const {\n      expandIcon\n    } = props;\n    const icon = expandIcon ? expandIcon(panelProps) : /*#__PURE__*/React.createElement(RightOutlined, {\n      rotate: panelProps.isActive ? 90 : undefined\n    });\n    return cloneElement(icon, () => ({\n      className: classNames(icon.props.className, `${prefixCls}-arrow`)\n    }));\n  };\n  const collapseClassName = classNames(`${prefixCls}-icon-position-${mergedExpandIconPosition}`, {\n    [`${prefixCls}-borderless`]: !bordered,\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-ghost`]: !!ghost\n  }, className, hashId);\n  const openMotion = Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false,\n    leavedClassName: `${prefixCls}-content-hidden`\n  });\n  const getItems = () => {\n    const {\n      children\n    } = props;\n    return toArray(children).map((child, index) => {\n      var _a;\n      if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {\n        const key = child.key || String(index);\n        const {\n          disabled,\n          collapsible\n        } = child.props;\n        const childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {\n          key,\n          collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined\n        });\n        return cloneElement(child, childProps);\n      }\n      return child;\n    });\n  };\n  return wrapSSR( /*#__PURE__*/React.createElement(RcCollapse, Object.assign({\n    openMotion: openMotion\n  }, props, {\n    expandIcon: renderExpandIcon,\n    prefixCls: prefixCls,\n    className: collapseClassName\n  }), getItems()));\n};\nCollapse.Panel = CollapsePanel;\nexport default Collapse;"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,UAAU,MAAM,aAAa;AACpC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,kBAAkB,MAAM,iBAAiB;AAChD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,QAAQ,MAAM,SAAS;AAC9B,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IACJC,YAAY;IACZC;EACF,CAAC,GAAGZ,KAAK,CAACa,UAAU,CAACV,aAAa,CAAC;EACnC,MAAM;IACJW,SAAS,EAAEC,kBAAkB;IAC7BC,SAAS,GAAG,EAAE;IACdC,QAAQ,GAAG,IAAI;IACfC,KAAK;IACLC,kBAAkB,GAAG;EACvB,CAAC,GAAGT,KAAK;EACT,MAAMI,SAAS,GAAGH,YAAY,CAAC,UAAU,EAAEI,kBAAkB,CAAC;EAC9D,MAAMK,aAAa,GAAGT,YAAY,EAAE;EACpC,MAAM,CAACU,OAAO,EAAEC,MAAM,CAAC,GAAGd,QAAQ,CAACM,SAAS,CAAC;EAC7C;EACAS,OAA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